Repository navigation
The pool walk's statistics no longer make a chunk of a large pool for every texture they ask about - #2085
Closed
lunks wants to merge 1 commit into
Closed
The pool walk's statistics no longer make a chunk of a large pool for every texture they ask about#2085lunks wants to merge 1 commit into
lunks wants to merge 1 commit into
Conversation
… every texture they ask about The first pool walk of a scene (and every 500th after) asks pool_find(lo, 1) where each registered texture's storage lies, to log how much of it is in wired pools; the raw-memory log's pool age asks the same. pool_find makes the chunk of a large pool's stride when it has none, and a length of 1 means BIG_UNKNOWN past the address: a zero-copy buffer of 80 MB or more, not in the residency set, counted by Metal in full. In Ocarina of Time's area load (pool of 2,432 MB, 153 strides) the walk made 77 of them, 6.7 GB of currentAllocatedSize for pages other buffers already map. pool_peek answers the same question without making anything. t_pool_chunks: 3 new checks. Reference entry and game note added.
betogzo
added a commit
to betogzo/nxnative
that referenced
this pull request
Nov 10, 2026
seedds#2030, seedds#2077, seedds#2022, seedds#2075, seedds#2085), last merged at 04811a6, and the Castle Town result on a MacBook Air M4 Castle Town on a 16 GB MacBook Air M4 at 30 fps and full resolution: GPU p50 26-27 ms a frame and 6.9 GB of GPU memory allocated with seedds#2085, against 16.2 GB and about 9 fps before it. Tests: dm/tools/tests/test_docs.py passes.
seedds
added a commit
that referenced
this pull request
Nov 10, 2026
…rge pool for every texture they ask about: the pool walk's log (the first pool-table build of a scene and every 500th after) and the raw-memory log's pool age asked pool_find(addr, 1), which for a large pool makes the stride's chunk, a zero-copy buffer reaching BIG_UNKNOWN past the address (80 MB and more), or lengthens a shorter one to that. In Ocarina of Time's area load (pool of 2,432 MB, 153 strides) that made 77 chunks outside the residency set, 6.7 GB of currentAllocatedSize; Metal went from 13.3 to 6.2 GB at the same point on an M5 Pro. pool_peek answers with the stride's chunk if it has one, else -1; it shares pool_find's search of the other entries (pool_held). t_pool_chunks: 3 new checks (PR #2085, issue #2068) Co-authored-by: Pedro Nascimento <91118+lunks@users.noreply.github.com>
Owner
|
Landed as 6f50de0, with you as co-author. Your diagnosis, |
FeReuss
pushed a commit
to FeReuss/nxnative-oot
that referenced
this pull request
Nov 10, 2026
… longer make a chunk of a large pool for every texture they ask about kept both sides of dm/games/0400486024DEC000/README.md Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
FeReuss
pushed a commit
to FeReuss/nxnative-oot
that referenced
this pull request
Nov 10, 2026
…ed commit, which the next merge brings Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
FeReuss
pushed a commit
to FeReuss/nxnative-oot
that referenced
this pull request
Nov 10, 2026
Conflicts resolved by hand: - seedds#2085, seedds#2078 and seedds#2065 came back from upstream as reworked commits (6f50de0, 12a44e0, 5e1c1ae): our three merges were reverted first, so the merge brings upstream's version instead of two copies. - GPU copies into a texture (copy_b2t, mirror_rb_land, nvn_obj.h): upstream's seedds#1310 rework (mspan_t, pkg_copy_absorb, for the readback case) and our seedds#2077 (mirror_rb_own, gsb_mark, for a texture the GPU owns) cover different cases and both stay: own = !rb is taken before the synchronous mirror, so the two paths exclude each other. mirror_rb_own passes no span. - loader.c: upstream's render-scale parse with the stub's largest scale (Hades II) and our graphics-scale tier block. t_readback.m: upstream's additive tests added to ours. pso_offline.py: its header comment. Docs and tables keep both sides; DM_RENDER_SCALE rows, render_base and the settings table take upstream's Hades II range plus our text. - dmsh_chain.h regenerated; .github/workflows/tests.yml follows upstream (a test list). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
iDams
pushed a commit
to iDams/nxnative
that referenced
this pull request
Nov 10, 2026
…rge pool for every texture they ask about: the pool walk's log (the first pool-table build of a scene and every 500th after) and the raw-memory log's pool age asked pool_find(addr, 1), which for a large pool makes the stride's chunk, a zero-copy buffer reaching BIG_UNKNOWN past the address (80 MB and more), or lengthens a shorter one to that. In Ocarina of Time's area load (pool of 2,432 MB, 153 strides) that made 77 chunks outside the residency set, 6.7 GB of currentAllocatedSize; Metal went from 13.3 to 6.2 GB at the same point on an M5 Pro. pool_peek answers with the stride's chunk if it has one, else -1; it shares pool_find's search of the other entries (pool_held). t_pool_chunks: 3 new checks (PR seedds#2085, issue seedds#2068) Co-authored-by: Pedro Nascimento <91118+lunks@users.noreply.github.com>
betogzo
added a commit
to betogzo/nxnative
that referenced
this pull request
Nov 10, 2026
and seedds#2085 in upstream's versions, the host at -O2, Ocarina of Time's camera-turn hitch in Hyrule Field (230 → 39 ms), 41 more task / mesh pipelines and 4,959 render / compute pipelines in its prewarm list, GPU writes into uploaded textures kept on the GPU, compact NVN recordings; chain 8f2d8a09c3f9 PR seedds#2030 (blend_zero) stays the fork's own: upstream moved the shader build's MSL rewrites into dmsh_rewrite.py (80fc2ec), so blend_zero and BLEND_ZERO move there, dmsh_build.py finish calls dmsh_rewrite.blend_zero, and test_dmsh_blend_zero.py imports it. dmsh_chain.h regenerated (8f2d8a09c3f9). Tests: test_dmsh_*.py 26/26 OK (test_dmsh_pairs with DM_GAME=0400486024DEC000); t_pool_chunks 151/0, t_cpu_storage 135/0, t_readback 218/0, t_pool_seen_replace 44/0, t_pool_standin 31/0, t_pool_notes 81/0, t_mesh_first_use 53/0.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
Ocarina of Time's area load makes GPU allocated jump by 6-10 GB and it stays there. zdevi's runs in #2068 on a 16 GB M5: 3.3 GB at frame 900, 15.8 GB at frame 1200, 17-18 GB after. Our M5 Pro census (
GPU allocation census) showed the same step: Metal minus the listed set went from 0.1-1.4 GB to 8 GB inside one area load and stayed.Cause: the pool walk's log (
pool walk: ... in wired pools, the first pool-table build of a scene and every 500th after) and the raw-memory log's pool age callpool_find(addr, 1)for where each texture's storage lies. For a large pool (BIG_MINand up)pool_findmakes the stride's chunk, a zero-copy buffer; length 1 meansBIG_UNKNOWNpast the address, so 80 MB or more, not in the residency set, overlapping its neighbours, used by no GPU work. Ocarina's pool is 2,432 MB (153 strides) and the walk touched 77 of them: 6.7 GB, whichcurrentAllocatedSizecounts in full for a no-copy buffer. The pages are shared, so resident memory does not grow by that much, but a 16 GB Mac reaches 17-18 GB allocated.Change:
pool_peek(addr)answers the same question with no side effect (the stride's entry if it has one, else -1); both statistics use it. Nothing else changes: lookups that the GPU needs still make their chunk.Relates to #2068 (does not claim to close it: that report also has slow stretches I have not isolated).
Checked
make -C dm/gfx/tests GAME=0400486024DEC000 check_t_pool_chunks(149 checks, 3 new: asking where an address is makes no chunk, peek finds the chunk of a stride that has one, peek of a stride with none returns -1 and still makes none),t_cpu_storage68,t_feedback207, all 0 failed;docs_symptoms.py --checkcurrent.regress.py checkwas not run: the change is two statistics and a read-only lookup.Docs
docs/reference/memory.md("The pool walk's statistics made chunks of a large pool"), the game note bullet, anddocs_symptoms.pyrun